//
//  HLInviteRequest.m
//  YueYue
//
//  Created by hulu001 on 2023/5/19.
//

#import "HLInviteRequest.h"

@implementation HLInviteRequest
{
    NSString *_inviteNo;
}

- (id)initWithInviteNo:(NSString *)inviteNo
{
    self = [super init];
    
    if (self) {
        _inviteNo = inviteNo;
    }
    
    return self;
}

- (id)initWithInfo
{
    self = [super init];
    
    if (self) {
        _inviteNo = nil;
    }
    
    return self;
}



- (NSString *)requestUrl
{
    if (_inviteNo){
        return [NSString stringWithFormat:@"/agent/bind_unbind/%@", _inviteNo];
    }
    return @"/agent/agent_user_info";
}

- (YTKRequestMethod)requestMethod
{
    if (_inviteNo){
        return YTKRequestMethodPOST;
    }
    return YTKRequestMethodGET;
}

- (HLInviteModel *)invite
{
    HLInviteModel *invite;
    
    NSDictionary *data = [self.result valueForKey:@"data"];
    if (![data isKindOfClass:[NSDictionary class]]){
        return invite;
    }
    invite = [HLInviteModel mj_objectWithKeyValues:data];
    

    return invite;
}
@end
